package com.kehutong.payfees.entity;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import com.kehutong.common.entity.DataEntity;
import org.coraframework.json.annotation.JSONField;
import org.coraframework.orm.Entity;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.Table;
import org.coraframework.orm.annotation.UnSave;

import com.kehutong.payfees.enums.BillCallMethod;
import com.kehutong.payfees.enums.BillCallState;
import com.kehutong.payfees.enums.BillEnableState;
import com.kehutong.payfees.enums.BillPaidState;
import com.kehutong.payfees.enums.BillPayMethod;
import com.kehutong.payfees.enums.GenerateType;

/**
 * 收费账单 缴费列表使用
 * 物业创建，用于向住户的收费凭证
 */
@Table(value = "t_charge_bill", comment="收费账单记录", multi = true)
public class ChargeBill extends DataEntity {

    private static final long serialVersionUID = 7631565953176123310L;

    protected ChargeBill(String id) {
        super(id);
        this.enableState = BillEnableState.UNUSED;
        this.paidState = BillPaidState.UNPAID;
        this.payMethod = BillPayMethod.NONE;
        this.lawyerCharge = false;
    }
    
    @Column(length=64, comment = "外部订单号")
    private String orderNo;

    @Column(comment = "小区名称")
    private String communityName;
    @Column(comment = "小区编号")
    private String communityNo;

    @Column(length = 64, comment = "栋名称")
    private String buildingName;
    @Column(comment = "栋编号")
    private String buildingNo;

    @Column(comment = "单元号(可为空)")
    private String unitNo;
    @Column(length = 64, comment = "单元名(可为空)")
    private String unitName;

    @Column(comment = "楼层号(可为空)")
    private String floorNo;
    @Column(comment = "楼层名")
    private String floorName;

    @Column(comment = "房屋信息")
    private String houseName;
    @Column(comment = "房屋编号")
    private String houseNo;

    @Column(comment = "账单周期-起")
    private LocalDate billDateFrom;
    @Column(comment = "账单周期-止")
    private LocalDate billDateTo;

    @Column(comment = "应付款日")
    private LocalDate shouldPayDate;

    @Column(comment = "总金额")
    private BigDecimal total;

    @Column(comment = "启用状态")
    private BillEnableState enableState;

    @Column(comment = "缴费状态")
    private BillPaidState paidState;

    @Column(comment = "付款方式")
    private BillPayMethod payMethod;

    @Column(comment = "催缴方式")
    private BillCallMethod callMethod;
    @Column(comment = "配置催缴时间")
    private LocalDateTime configCallAt;
    @Column(comment = "催缴状态")
    private BillCallState callState;

    @Column(comment = "实际支付时间")
    private LocalDateTime paidAt;

    @JSONField(serialize = false)
    @Column(comment = "逻辑删除")
    private boolean deleted;

    @Column(comment = "对应充值记录id，仅记录")
    private String chargeRecordId;

    @Column(comment = "付款人编号")
    private String payerNo;
    @Column(comment = "付款人姓名")
    private String payerName;
    @Column(comment = "付款人手机号")
    private String payerMobile;

    @Column(comment = "生成缴费的编号")
    private String generateNo;
    @Column(comment = "生成类型")
    private GenerateType generateType;

    @Column(comment = "是否发起过律师催缴")
    private Boolean lawyerCharge;

    @Column(comment = "上传PDF文件id")
    private String fileId;

    @Column(comment = "缴费单文件id")
    private String payFileId;

    @UnSave
    private List<ChargeBillItem> billItems;

    @UnSave
    private List<ChargeBillAnnex> billAnnexes;

    @UnSave
    private Integer billYear;
    @UnSave
    private Integer billMonth;
    
    public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

    public String getCommunityName() {
        return communityName;
    }

    public void setCommunityName(String communityName) {
        this.communityName = communityName;
    }

    public String getCommunityNo() {
        return communityNo;
    }

    public void setCommunityNo(String communityNo) {
        this.communityNo = communityNo;
    }

    public String getBuildingName() {
        return buildingName;
    }

    public void setBuildingName(String buildingName) {
        this.buildingName = buildingName;
    }

    public String getBuildingNo() {
        return buildingNo;
    }

    public void setBuildingNo(String buildingNo) {
        this.buildingNo = buildingNo;
    }

    public String getUnitNo() {
        return unitNo;
    }

    public void setUnitNo(String unitNo) {
        this.unitNo = unitNo;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public String getFloorNo() {
        return floorNo;
    }

    public void setFloorNo(String floorNo) {
        this.floorNo = floorNo;
    }

    public String getFloorName() {
        return floorName;
    }

    public void setFloorName(String floorName) {
        this.floorName = floorName;
    }

    public String getHouseName() {
        return houseName;
    }

    public void setHouseName(String houseName) {
        this.houseName = houseName;
    }

    public String getHouseNo() {
        return houseNo;
    }

    public void setHouseNo(String houseNo) {
        this.houseNo = houseNo;
    }

    public LocalDate getBillDateFrom() {
        return billDateFrom;
    }

    public void setBillDateFrom(LocalDate billDateFrom) {
        this.billDateFrom = billDateFrom;
    }

    public LocalDate getBillDateTo() {
        return billDateTo;
    }

    public void setBillDateTo(LocalDate billDateTo) {
        this.billDateTo = billDateTo;
    }

    public LocalDate getShouldPayDate() {
        return shouldPayDate;
    }

    public void setShouldPayDate(LocalDate shouldPayDate) {
        this.shouldPayDate = shouldPayDate;
    }

    public BigDecimal getTotal() {
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }

    public BillEnableState getEnableState() {
        return enableState;
    }

    public void setEnableState(BillEnableState enableState) {
        this.enableState = enableState;
    }

    public BillPaidState getPaidState() {
        return paidState;
    }

    public void setPaidState(BillPaidState paidState) {
        this.paidState = paidState;
    }

    public BillPayMethod getPayMethod() {
        return payMethod;
    }

    public void setPayMethod(BillPayMethod payMethod) {
        this.payMethod = payMethod;
    }

    public BillCallMethod getCallMethod() {
        return callMethod;
    }

    public void setCallMethod(BillCallMethod callMethod) {
        this.callMethod = callMethod;
    }

    public LocalDateTime getConfigCallAt() {
        return configCallAt;
    }

    public void setConfigCallAt(LocalDateTime configCallAt) {
        this.configCallAt = configCallAt;
    }

    public BillCallState getCallState() {
        return callState;
    }

    public void setCallState(BillCallState callState) {
        this.callState = callState;
    }

    public LocalDateTime getPaidAt() {
        return paidAt;
    }

    public void setPaidAt(LocalDateTime paidAt) {
        this.paidAt = paidAt;
    }

    public List<ChargeBillItem> getBillItems() {
        return billItems;
    }

    public void setBillItems(List<ChargeBillItem> billItems) {
        this.billItems = billItems;
    }

    public List<ChargeBillAnnex> getBillAnnexes() {
        return billAnnexes;
    }

    public void setBillAnnexes(List<ChargeBillAnnex> billAnnexes) {
        this.billAnnexes = billAnnexes;
    }

    public Integer getBillYear() {
        return billYear;
    }

    public void setBillYear(Integer billYear) {
        this.billYear = billYear;
    }

    public Integer getBillMonth() {
        return billMonth;
    }

    public void setBillMonth(Integer billMonth) {
        this.billMonth = billMonth;
    }

    public boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }

    public String getChargeRecordId() {
        return chargeRecordId;
    }

    public void setChargeRecordId(String chargeRecordId) {
        this.chargeRecordId = chargeRecordId;
    }

    public boolean getEnable() {
        return enableState == BillEnableState.ENABLE;
    }

    public String getPayerNo() {
        return payerNo;
    }

    public void setPayerNo(String payerNo) {
        this.payerNo = payerNo;
    }

    public String getPayerName() {
        return payerName;
    }

    public void setPayerName(String payerName) {
        this.payerName = payerName;
    }

    public String getPayerMobile() {
        return payerMobile;
    }

    public void setPayerMobile(String payerMobile) {
        this.payerMobile = payerMobile;
    }

    public String getGenerateNo() {
        return generateNo;
    }

    public void setGenerateNo(String generateNo) {
        this.generateNo = generateNo;
    }

    public GenerateType getGenerateType() {
        return generateType;
    }

    public void setGenerateType(GenerateType generateType) {
        this.generateType = generateType;
    }

    public Boolean getLawyerCharge() {
        return lawyerCharge;
    }

    public void setLawyerCharge(Boolean lawyerCharge) {
        this.lawyerCharge = lawyerCharge;
    }

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getPayFileId() {
        return payFileId;
    }

    public void setPayFileId(String payFileId) {
        this.payFileId = payFileId;
    }
}
